package com.source.hotelbath.weight.listview.ptr.ptrloadmore;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ExpandableListView;

import com.source.hotelbath.R;


/**
 * Created by kinglong on 15-1-30.
 */
public class PtrLoadMoreExpandableListView extends PtrLoadMoreBase<ExpandableListView> {


    private ExpandableListView mEpListView;

    public PtrLoadMoreExpandableListView(Context context) {
        super(context);

        mEpListView = (ExpandableListView) LayoutInflater.from(context).inflate(R.layout.ptr_expnd_listview, null).findViewById(R.id.eplv_content);
        setRefreshView(mEpListView);
    }

    public PtrLoadMoreExpandableListView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mEpListView = (ExpandableListView) LayoutInflater.from(context).inflate(R.layout.ptr_expnd_listview, null).findViewById(R.id.eplv_content);
        setRefreshView(mEpListView);
    }

    /**
     * 初始化得时候设置没有下一页
     */
    public void setFooterView() {       //可以根据需求项目继承重写footerview
        if(-1==mFooterLayoutId){
            mFooterView = LayoutInflater.from(getContext()).inflate(R.layout.ptr_load_more_listview_footer, null);
            mAbsListView.addFooterView(mFooterView);
            setHasNext(false);
        }else{
            mFooterView = LayoutInflater.from(getContext()).inflate(mFooterLayoutId, null);
            mAbsListView.addFooterView(mFooterView);
            setHasNext(false);
        }

    }

}
